package com.hopechart.micro.common.constant;

/**
 * <p>
 *     <br/>客户端相应结果
 * </p>
 * @author daijiang@hopechart.com
 * @date 2017-10-30 08:57:42
 * @copyright 杭州鸿泉数字设备有限公司
 * @version V1.0.0
 */
public class Response {

    private Integer code;

    private String message = "操作成功";

    private Object data = null;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        if(null == data) {
            this.data = new Object();
        } else {
            this.data = data;
        }
    }

    public Response() {
    }

    public Response(Integer code) {
        this.code = code;
    }

    public Response(Integer code, Object data) {
        this.code = code;
        this.data = data;
    }

    public Response(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Response(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
}
